<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var ary = [9,9,81,5,18,4,29,99,7,4,22,2,3,1,3,99]
        function shuZu(arr) {
            var newArr = []
            for (var i = 0; i < arr.length; i++) {
                if(newArr.indexOf(arr[i]) === -1) newArr.push(arr[i])
            }
            return newArr
        }
        console.log(shuZu(ary));
    </script>
</body>
</html>